import { get, post, put, del, postWithErrorMessage, putWithErrorMessage } from '@/utils/http/Axios'
// 查询流程列表
export function getWorkflowList(data: any) {
    return post('/taishan-runtime/api/v2/process_definition/search', data).then(resp => resp.data)
}
// 查询角色
export function getRole(tenantId: string | number) {
    return get(`/base/api/v1/role/all/${tenantId}`).then(resp => resp.data)
}
// 查询用户列表
export function getUserSearch(data: any) {
    return post('/base/api/v1/user/search', data).then(resp => resp.data)
}
// 查询用户组列表
export function getUserGroupSearch(data: any) {
    return post('/base/api/v1/user_group/search', data).then(resp => resp.data)
}
// 查询部门列表
export function getDepartment(data: any) {
    return post('/base/api/v1/department/search', data).then(resp => resp.data)
}
// 新增流程
export function addWorkflowProcess(data: any) {
    return post('/taishan-runtime/api/v2/process_definition', data).then(resp => resp.data)
}
// 删除流程
export function delWorkflowProcess(id: string | number) {
    return del(`/taishan-runtime/api/v2/process_definition/${id}`).then(resp => resp.data)
}
// 发布流程
export function putWorkflowProcessRelease(id: string | number) {
    return put(`/taishan-runtime/api/v2/process_definition/${id}/release`).then(resp => resp.data)
}
// 获取流程详情v6
export function getWorkflowProcessV6(id: string | number) {
    return get(`/taishan-runtime/api/v6/process_definition/${id}`).then(resp => resp.data)
}
// 修改流程 编辑 流程 v6
export function saveWorkflowProcessV6(id: string | number, data: any) {
    return putWithErrorMessage(`/taishan-runtime/api/v6/process_definition/${id}`, data).then(resp => resp.data)
}
// 新增流程v6
export function addWorkflowProcessV6(data: any) {
    return postWithErrorMessage('/taishan-runtime/api/v6/process_definition', data).then(resp => resp.data)
}
// 获取数据源
export function getWorkFlowDataSource(data: any) {
    return post(`/taishan-runtime/api/v1/datasource/list`, data).then(resp => resp.data)
}
